// pages/userhome/address/address.js
var app = getApp();
Page({
  data: {
  },
  onLoad: function (options) {
    var that = this;
    // 页面初始化 options为页面跳转所带来的参数
    //获取手机高度
    this.setData({
      navH: app.globalData.navHeight,
      trackingNumber: options.trackingNumber,
      type: options.status,
      expressCompany: options.expressCompany,
      expressCompanyCode: options.expressCompanyCode,
      list1: options.expressInfo,
      thumbnailimage: options.thumbnailimage,
      telephone:options.telephone
    })
    var expressInfo = that.data.list1
    if (expressInfo!=undefined) {
      that.setData({
        list: JSON.parse(expressInfo),
      })
    }
    console.log(expressInfo)
    if (expressInfo == 'undefined' || expressInfo == undefined) {
    
        wx.request({
          url: app.globalData.url + "orderExpressQuery",
          header: {
            "content-type": "application/x-www-form-urlencoded"
          },
          data: {
            expressCompanyCode: options.expressCompanyCode,
            trackingNumber: options.trackingNumber,
            telephone:that.data.telephone
          },
          method: "POST",
          success: function (res) {
            var data = res.data;
            if (data.result === 1) {
              that.setData({
                list:data.data.data,
                status:data.data
              })
            }
          }
        })
    }
  },
  onReady: function () {
    // 页面渲染完成
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  },
  navBack: function () {
    wx.navigateBack({

    })
  }
})